% phase correlation
% IEEE SPL *** need to be filled

% latest date 11.12.2002

function[R]=phcor(a,b),

block = length(a);
WI = hanning(block);
a = a - (sum(a)/block);
b = b - (sum(b)/block);
a = WI.*a';
b = WI.*b';
Fa = fft(a);
Fb = fft(b);
Fa(1) = [];
Fb(1) = [];
Fab = conj(Fa).*Fb;
DetAB = abs(conj(Fa).*Fb);
R = max(abs(ifft(Fab./DetAB)));

